/*
 * QtImage.h
 *
 *  Created on: Mar 11, 2011
 *      Author: kmueller
 */

#ifndef QTIMAGE_H_
#define QTIMAGE_H_

#include "../core/Opennav.h"

#include "../gui/MapWidget.h"

#include <vector>

#include <QColor>
#include <QFont>
#include <QPainter>

class QtImage: public opennav::CanvasInterface {
public:
	QtImage(QPainter* painter, int width, int height);
	~QtImage();
//	result Construct(Osp::Graphics::Canvas* canvas);

public:
	void set_foreground_color(opennav::Color& color);
	void set_background_color(opennav::Color& color);
	void set_line_width(int32_t width);
	void set_font(const opennav::Font& font);
	void draw_lines(const std::vector<opennav::Point>& polyline);
	void draw_line(const opennav::Point& a, const opennav::Point& b);
	void draw_polygon(const std::vector<opennav::Point>& polygon);
	void draw_rectangle(const opennav::Point& point, int32_t width,
			int32_t height);
	void draw_circle(const opennav::Point& center, int32_t radius);
	void draw_text(const opennav::Point& point, const std::string& text);
	void draw_text_tilted(const opennav::Point& center, const std::string&text,
			int dx, int dy);
	void get_text_dimension(const std::string& text,
			opennav::Dimension& dimension);

	int32_t width();
	int32_t height();

private:
//	QFont* GetFont();

	QPainter* pCanvas;
	int pWidth, pHeight;
	QColor pForeground;
	QColor pBackground;
	QFont pFont;
};

#endif /* QTIMAGE_H_ */
